package org.dromara.common.model.enums.im;

/**
 * 类别变更状态枚举
 */
public enum CategoryChangeStatusEnum {
    WAITING_FOR_APPROVAL(0, "等待同意"),
    NO_CHANGE_NEEDED(1, "无需变更"),
    APPROVED_CHANGE(2, "已同意变更");

    private final int code;
    private final String name;

    CategoryChangeStatusEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static CategoryChangeStatusEnum getByCode(int code) {
        for (CategoryChangeStatusEnum status : values()) {
            if (status.getCode() == code) {
                return status;
            }
        }
        throw new IllegalArgumentException("No CategoryChangeStatus found with code: " + code);
    }
}
